#!/bin/bash
read -p "Please input your ip: " ip
ping -w 1 $ip &>/dev/null
if [ $? -eq 0 ]
then
    echo "$ip Ok"
else
    echo "$ip No"
fi